﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OpportAllocation.aspx.cs" Inherits="WMS6.Web.CrossDock.OpportAllocation" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>ASN</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />
    <script src="../Js/jquery.js" type="text/javascript"></script>
    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script> 
    <script src="../Js/util.js" type="text/javascript"></script>
    <script src="../Js/InitPage.js" type="text/javascript"></script>
    <script src="../Js/Verification.js" type="text/javascript"></script>
    <script src="../Js/checkbox.js" type="text/javascript"></script>
    <script src="../Js/calendar.js" type="text/javascript" charset="gb2312"></script>
   
    <script type="text/javascript">
        //初始化页面
        window.onload = function(){
            initEditNewPage();
        }
        
        function newASN()
        {
            var from = document.getElementById("hdnFrom").value;
            window.location.href = "OpportAllocation.aspx?from=" + from;
            return false;
        }
        
        //弹出窗口选择PO
        function popPurchaseOrderQuery()
        {
            var rtnValue = popModalWindow('../OrderManagement/PurchaseOrderQuery.aspx?action=txtPoID','dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;')
            var temp = document.getElementById("hdnInportValue").value ;
            if(rtnValue != null && rtnValue.toString() != "")
            {
                setTab('one',1,6);
                //document.getElementById("txtPoID").focus();
                document.getElementById("txtPoID").value = rtnValue;           
                document.getElementById("hdnImportPOValue").value = rtnValue;    
//                if(rtnValue == temp)
//                {
                    if(document.getElementById("btnInputPO") != null)
                    {       
                        document.getElementById("hdnPageType").value = "1";           
                        document.getElementById("btnInputPO").click();
                    }
//                }
            }
            document.getElementById("hdnInportValue").value = rtnValue;
        }
        
        //弹出窗口选择货主
        function selectOwner()
        {
            var rtnValue = popModalWindow('../Configuration/OwnerQuery.aspx?action=txtOwnerID','dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if(rtnValue != null && rtnValue.toString() != "")
            {
                document.getElementById("txtOwnerID").focus();
                document.getElementById("txtOwnerID").value = rtnValue;
            }
        }
        
        //弹出窗口选择供应商
        function selectVendor()
        {
            var rtnValue = popModalWindow('../Configuration/VendorQuery.aspx?action=txtVendorID','dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if(rtnValue != null && rtnValue.toString() != "")
            {
                document.getElementById("txtVendorID").focus();
                document.getElementById("txtVendorID").value = rtnValue;
                   document.getElementById("hdnPageType").value = "1"; //标识符，标识本次操作是否会导致页面刷新 默认0  1代表会刷新
                __doPostBack("txtVendorID_TextChanged","");
            }
        }
        
        //弹出窗口选择承运商
        function selectCarrier()
        {
            var rtnValue = popModalWindow('../Configuration/CarrierQuery.aspx?action=txtCarrierID','dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if(rtnValue != null && rtnValue.toString() != "")
            {
                document.getElementById("txtCarrierID").focus();
                document.getElementById("txtCarrierID").value = rtnValue;
                   document.getElementById("hdnPageType").value = "1"; //标识符，标识本次操作是否会导致页面刷新 默认0  1代表会刷新
                __doPostBack("txtCarrierID_TextChanged","");
            }
        }
        
        //弹出 打印 入库验收单 的窗口
        function popPrintReceipt()
        {
            var receiptID = document.getElementById("txtReceiptID").value;
            window.open('../Common/PrintReport.aspx?rtype=printreceipt&receiptID='+receiptID,'PrintWindow','width=860,height=610,top=50,left=50,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no,status=no');
        }
                
        function showAction()
		{	
			var pos = getElementPos("btnAction");	
			document.getElementById("actionDiv").style.top = pos.y+17;
			document.getElementById("actionDiv").style.left = pos.x;  			
			document.getElementById("hiddenFlag").value = '1';
		}
		
		//显示 报表 DIV
		function showReport()
		{	
			var pos = getElementPos("htmlbtnReport");	
			document.getElementById("reportDiv").style.top = pos.y+17;
			document.getElementById("reportDiv").style.left = pos.x;  			
			document.getElementById("hiddenReportFlag").value = '1';
		}
		
       function hiddenDiv()
		{
			var flag = document.getElementById("hiddenFlag").value
			if(flag == "1")
			{
				document.getElementById("actionDiv").style.display = "block";
				document.getElementById("hiddenFlag").value = '0';
			}
			else 
			{
				document.getElementById("actionDiv").style.display = "none";
			}
		}
		//隐藏 报表 DIV
		function hiddenReportDiv()
		{
			var flag = document.getElementById("hiddenReportFlag").value
			if(flag == "1")
			{
				document.getElementById("reportDiv").style.display = "block";
				document.getElementById("hiddenReportFlag").value = '0';
			}
			else 
			{
				document.getElementById("reportDiv").style.display = "none";
			}
		}
			   //导入
	   function DataImport()
		{		    
		   var rtnValue = popModalWindow('../Common/ImporData.aspx?action=RECEIPTDETAIL&OrderID='+document.getElementById('txtReceiptID').value+'&OwnerID='+document.getElementById('txtOwnerID').value,'dialogWidth=520px;dialogHeight=300px;center=yes;resizable=yes;status=no;')
		   if(rtnValue != "")
		   {
		      window.location.href = "ASN.aspx?from=list&ID="+document.getElementById('txtReceiptID').value;
		   }
		}
		
        function GetASNByReceiptID()
		{
//		    document.getElementById("hdnPageType").value = "1";
//		    var poID = document.getElementById("<%=txtReceiptID.ClientID %>").value;
//		    var varForm = document.getElementById("<%=hdnFrom.ClientID%>").value;
//		    window.location.href("ASN.aspx?from="+varForm+"&ID="+poID);
		}

		function confirmMsg(code) {
		    if (code == "F4100_001") {
		        if (confirm('<%=GetGlobalMsgResource("F4100_001") %>')) {
		            return true;
		        }
		        else {
		            return false;
		        }
		    }
		}
    </script>
</head>
<body onbeforeunload="SavePageValue('btnSave','hdnPageQty');">
    <form id="F4011" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom"><asp:Label ID="lblOwner" runat="server" CssClass="label_header" 
                            Text="分配" meta:resourcekey="lblOwner"></asp:Label></td>
                    <td><asp:Button ID="btnGoBack" runat="server" CssClass="button"  Text="<%$Resources:ButtonResource,btnGoBack%>"  
                            CausesValidation="False" onclick="btnGoBack_Click" 
                           /></td>
                    <td><asp:Button ID="btnNew" runat="server" CssClass="button"
                            Text="<%$Resources:ButtonResource,btnNew%>"  AccessKey="n" OnClientClick="newASN();return false;" 
                            /></td>
                    <td><asp:Button ID="btnSave" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnSave%>" 
                            AccessKey="s" onclick="btnSave_Click"  
                            OnClientClick="SethdnPageQty('hdnPageQty');" 
                               /></td>
                    <td><asp:Button ID="btnDelete" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnDelete%>"  
                            AccessKey="d" 
                          OnClientClick="javascript:if(confirmMsg('F4100_001')) return true; else return false;"
                            onclick="btnDelete_Click"  /></td>
                    <td><asp:Button ID="btnCopy" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnCopy%>" 
                            AccessKey="c" onclick="btnCopy_Click" 
                           /></td>
                    </tr>
            </table>
        </div>
        
        
        <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
                <div>
                    <asp:Label ID="lblMsg" runat="server" CssClass="label_message" 
                        meta:resourcekey="lblMsg"></asp:Label>
                </div>
                
               <div id="div_menu">
                    <div style="float: left; width: 8px;">
                        <div class="tabL" id="divL1"></div>
                    </div>
                    <div style="float:left;" class="tabLabelCont tabCur" onclick="setTab('one',1,2)" id="divM1">
                        <asp:Label ID="one1" CssClass="hover" runat="server" 
                           >常规</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR" id="divR1"></div>
                    </div>
                    
                    <div style="float: left; width: 8px;">
                        <div class="tabL_1" id="divL2"></div>
                    </div>
                    <div style="float:left;" class="tabLabelCont tabCur_1" onclick="setTab('one',2,2);" id="divM2">
                        <asp:Label ID="one2" CssClass="navigationlabel" runat="server" 
                          >&nbsp;分配明细&nbsp;</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR_1" id="divR2"></div>
                    </div>
                    
               </div>
            
         <div id="div_content">
                 <div id="con_one_1" style="display:block;">
                    <table width="720px" style="display: block; margin-left: 10px; margin-top: 10px;">
                        <tr>
                            <td width="180px">
                                <asp:Label ID="lblReceiptID" CssClass="label" runat="server" Text="货主" 
                                    meta:resourcekey="lblReceiptID"></asp:Label>
                            </td>
                            <td width="180px">
                              
                            </td>
                            
                            <td width="180px">
                             
                            </td>
                            <td width="180px">
                            
                            </td>
                        </tr>
                        <tr>
                            <td width="180px">
                                <asp:TextBox ID="txtReceiptID" runat="server" CssClass="textbox" 
                                    MaxLength="20"   Text="MIDEA"                               
                                    meta:resourcekey="txtReceiptID"  ></asp:TextBox>
                            </td>
                            <td width="180px">
                                
                            </td>
                            <td width="180px">
                               
                            </td>
                            <td width="180px">
                                   </td>
                        </tr>
                          <tr>
                            <td width="180px">
                                <asp:Label ID="Label2" CssClass="label" runat="server" Text="货品" 
                                    meta:resourcekey="lblReceiptID"></asp:Label>
                            </td>
                            <td width="180px">
                              
                            </td>
                            
                            <td width="180px">
                             
                            </td>
                            <td width="180px">
                            
                            </td>
                        </tr>
                        <tr>
                            <td width="180px">
                                <asp:TextBox ID="TextBox2" runat="server" CssClass="textbox" 
                                    MaxLength="20"   Text="2M210-M1"                               
                                    meta:resourcekey="txtReceiptID"></asp:TextBox>
                            </td>
                            <td width="180px">
                                
                            </td>
                            <td width="180px">
                               
                            </td>
                            <td width="180px">
                                   </td>
                        </tr>
                          <tr>
                            <td width="180px">
                                <asp:Label ID="Label1" CssClass="label" runat="server" Text="描述" 
                                    meta:resourcekey="lblReceiptID"></asp:Label>
                            </td>
                            <td width="180px">
                              
                            </td>
                            
                            <td width="180px">
                             
                            </td>
                            <td width="180px">
                            
                            </td>
                        </tr>
                        <tr>
                            <td width="180px" colspan=2>
                                <asp:TextBox ID="TextBox1" runat="server" CssClass="largetextbox" 
                                    MaxLength="20"   Text="磁控管"                               
                                    ></asp:TextBox>
                            </td>
                            <td width="180px">
                                
                            </td>
                            <td width="180px">
                               
                            </td>
                            <td width="180px">
                                   </td>
                        </tr>
                        <tr style="height:10px;"><td> </td><td></td><td></td><td></td></tr>
                    </table>
                 </div>
                 

                 
                 <div id="con_one_2" style="display:none; overflow-x:auto; overflow-y:hidden; ">
                    <table width="1080px" style="display: block; margin-left: 10px; margin-top: 10px;">
                         <tr style="height:10px;">
                            <td></td>
                            <td></td>
                         </tr>
                         <tr>
                            <td>
                                <div>
                                
                                <table class="gridview" cellspacing="0" rules="all" border="1" id="gvReceipt" style="width:800px;
                        border-collapse: collapse;">
                        <tr class="GridViewHeaderStyle">
                            <th scope="col">
                                序号
                            </th>
                            <th class="GridViewRowWidth_40" align="center" scope="col">
                                <input id="gvReceipt_ctl01_CheckBox1" type="checkbox" name="gvReceipt$ctl01$CheckBox1"
                                    onclick="selectAll(this,'gvReceipt');" />
                            </th>
                            <th scope="col">
                                <a href="javascript:__doPostBack('gvReceipt','Sort$RECEIPT_ID')">客户</a>
                            </th>
                            <th scope="col">
                                <a href="javascript:__doPostBack('gvReceipt','Sort$OWNER_ID')">发货订单号</a>
                            </th>
                            <th scope="col">
                                <a href="javascript:__doPostBack('gvReceipt','Sort$OWNER_ID')">订单日期</a>
                            </th>
                            <th scope="col">
                                <a href="javascript:__doPostBack('gvReceipt','Sort$OWNER_ID')">要求发货日期</a>
                            </th>
                              <th scope="col">
                                <a href="javascript:__doPostBack('gvReceipt','Sort$OWNER_ID')">开放数量</a>
                            </th>
                              <th scope="col">
                                <a href="javascript:__doPostBack('gvReceipt','Sort$OWNER_ID')">顺序</a>
                            </th>
                            
                        </tr>
                        <tr id="gvReceipt_ctl02" class="GridViewRowStyle" onmouseout="GridViewRowMouseout(this);"
                            onmouseover="GridViewRowMouseover(this);" id="gvReceipt_ctl02">
                            <td class="GridViewRowWidth_40">
                                1
                            </td>
                            <td class="GridViewRowWidth_40" align="center">
                                <input id="gvReceipt_ctl02_chbSelect" type="checkbox" name="gvReceipt$ctl02$chbSelect"
                                    onclick="GridViewCheckBoxClick('gvReceipt_ctl02');" />
                            </td>
                            <td class="GridViewRowWidth_150">
                                <a id="gvReceipt_ctl02_HyperLink1" class="hyperlink" href="#"
                                    target="_self">家乐福广州</a>
                            </td>
                            <td class="GridViewRowWidth_150">
                              0000001094
                            </td>
                              <td class="GridViewRowWidth_150">
                          2010-05-20
                            </td>
                              <td class="GridViewRowWidth_150">
                            2010-05-20
                            </td>
                              <td class="GridViewRowWidth_150">
                        20
                            </td>
                             <td class="GridViewRowWidth_150">
                       1
                            </td>
                        </tr>
                    </table>
                                    
                            </div>
                            </td>
                            <td></td>
                         </tr>
                              <tr style="height:30px;">
                            <td></td>
                            <td></td>
                         </tr>
                     </table>  
                 </div>
             
           </div>
           
          
                <input type="hidden" id="hiddenFlag" />
                <input type="hidden" id="hdnLineID" runat="server" >
                    <input id="hdnReceiptID" runat="server" type="hidden"></input>
                        <input id="hdnFlag" runat="server" type="hidden" value="0"></input>
                            <input id="hdnType" runat="server" type="hidden"></input>
                                <input id="hdnCopy" runat="server" type="hidden"></input>
                                    <input id="hiddenReportFlag" type="hidden" />
                                    <input id="hdnPageQty" runat="server" type="hidden" value="0"></input>
                                        <input id="hdnPageType" runat="server" type="hidden" value="0"></input>
                                        </input>
                                    </input>
                                </input>
                            </input>
                        </input>
                    </input>
                </input>
            </ContentTemplate>
<%--                 <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnNew" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="btnCopy" EventName="Click" />
                </Triggers>--%>  
      </asp:UpdatePanel>
            <input type="hidden" id="hdnFrom" runat="server" />
            <input type="hidden" id="hdnInportValue" runat="server"  />
            <input type="hidden" id="hdnImportPOValue" runat="server"  />
            <input type="hidden" id="hdnIspalletized" runat="server" />
            <input type="hidden" id="hdnDataFormat"  runat="server"/>  
            <input type="hidden" id="hdncalendarFlag"  runat="server"/>  
          

    </div>
    </form>
</body>
</html>
